package com.itheima.jobs;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.service.OrderSettingService;
import com.itheima.utils.DateUtils;

import java.util.Date;


public class clearOrderSetting {
    @Reference
    private OrderSettingService orderSettingService;
    /*
        定时请清理预约人数
     */
    public void clearOrderSettingDate() throws Exception {

        //获取当天日期
        Date today = DateUtils.getToday();
        //日期转
        String s = DateUtils.parseDate2String(today);
        //获取当天日期，从当天日期的前一天开始清理即可。
        orderSettingService.deleteOrderSettingByTime(s);
    }
}
